package com.gxa.saas.service.impl;

import com.gxa.saas.mapper.ClientMapper;
import com.gxa.saas.pojo.Client;
import com.gxa.saas.service.ClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("CilentService")
public class CilentServiceImpl implements ClientService {
    @Autowired
    ClientMapper clientMapper;


    @Override
    public List<Client> selectByPage(Integer page, Integer limit) {
        return this.clientMapper.selectByPage((page-1) * limit,limit);
    }

    @Override
    public List<Client>  selectByNameOrContactpersonOrCreatypersonOrLeaderperson(Map map) {
        return clientMapper.selectByNameOrContactpersonOrCreatypersonOrLeaderperson(map);
    }

    @Override
    public Client selectByPhone(String phone) {
        return clientMapper.selectByPhone(phone);

    }

    @Override
    public Integer inert(Client client) {
        return clientMapper.insert(client);
    }

    @Override
    public void delete(Integer id) {
        clientMapper.delete(id);
    }

    @Override
    public void update(Client client) {
        clientMapper.update(client);
    }

    @Override
    public List<Client> selectAll() {
        List<Client> clients = clientMapper.selectAll();
        return clients;
    }

}
